<script setup>
defineProps({
  title: String,
  list: Array
})
</script>

<template>
  <div class="card">
    <div class="card-header">
      <span class="card-title">{{ title }}</span>
      <span class="card-more">更多 &gt;</span>
    </div>
    <div class="card-list">
      <div class="card-item" v-for="(item, idx) in list" :key="idx">
        <span class="item-icon"><img src="/images/主页/u19.png" alt="icon" width="50%"></span>
        <span class="item-title">{{ item.title }}</span>
        <span class="item-date">{{ item.date }}</span>
      </div>
    </div>
  </div>
</template>

<style scoped>
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #e0f7fa55;
  padding: 18px 20px 10px 20px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0f7fa;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.card-title {
  font-size: 20px;
  font-weight: bold;
  color: #1abc9c;
}
.card-more {
  color: #888;
  font-size: 14px;
  cursor: pointer;
}
.card-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-item {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: #333;
  justify-content: flex-start;

}
.item-icon {
  margin-right: 8px;
  color: #1abc9c;
}
.item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.item-date {
  color: #aaa;
  font-size: 13px;
  margin-left: 12px;
}
</style>